{% extends "dissemin/skeleton.html" %}

{% load i18n %}

{% block headTitle %}
{{ institution }}
{% endblock %}

{% block extra_head %}
{% include 'statistics/headers.html' %}
{% endblock %}

{% block content %}
<div id="fullPage">
    <h2>{{ institution }}</h2>

    <p><img src="{{ institution.country.flag }}"
	alt="{{ institution.country.code }}" />&nbsp;
	{{ institution.country.name }}</p>
  
  <ul id="departmentsList">
  {% for dept in institution.sorted_departments %}
    <li>
         <h2><a href="{% url 'department' dept.id %}">{{ dept }}</a></h2>
         {% include 'statistics/pie.html' with obj=dept stats_counter=forloop.counter %}
    </li>
  {% endfor %}
  </ul>
  <ul id="membersList" class="noCircle">
    {% for person in institution.sorted_researchers %}
    {% ifchanged person.name.first_letter %}
    <li class="membersLetter">{{ person.name.first_letter }}</li>
    {% endifchanged %}
    <li><a href="{{ person.url }}">{{ person }}</a>
           {% if person.stats %}
           <span class="numPapers">
               {% blocktrans trimmed count num_total=person.stats.num_tot %}
               ({{ num_total }} paper)
               {% plural %}
               ({{ num_total }} papers)
               {% endblocktrans %}
           </span>
           {% endif %}

        {% if request.user.is_superuser %}
            <button type="button" class="close researcherDeleteButton"
                id="delete-researcher-{{ person.id }}"
                data-undotext="{% trans "Researcher deleted. " %}"
                data-undoundo=""
                data-undolink="#"
                data-undoclass="">
                <span aria-hidden="true">&times;</span><span class="sr-only">{% trans "Delete" %}</span>
            </button>
        {% endif %}

    </li>
    {% endfor %}
    </ul>

 
</div>
{% endblock %}
